//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __MODULE_SECTION_H__
#define __MODULE_SECTION_H__

#include <aura.h>

class Section {
public:
    Aura_UInt32         m_uImageBase;
    
    char            m_szName[9];

    Aura_UInt32          m_uVAddr;
    Aura_UInt32          m_uVSize;
    Aura_UInt32          m_uProtect;

public:
    void Initialize() {
        m_szName[9] = 0;
        m_uProtect = 0;
    }

    void MemZero();
    
    void RelocAddr(Aura_UInt32 vAddr, Aura_UInt32 uOffset, Aura_UInt32 uType);

    void MemCopy(void * p, int nSize);

    void MemCopy(Aura_UInt32 uOffset, Aura_UInt32 uSize, void * p);

    void SetAddr(Aura_UInt32 uAddr) {
        m_uVAddr = uAddr;
    }

    void SetSize(Aura_UInt32 uSize) {
        m_uVSize = uSize;
    }
    
    void SetImageBase(Aura_UInt32 uImageBase) {
        m_uImageBase = uImageBase;
    }
};

#endif  //__MODULE_SECTION_H__

